package com.sun.web.controller;

import com.sun.entity.User;
import com.sun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by pullFoot_youth on 2017/3/13.
 */
@Controller
public class ViewController {

    @Autowired
    private UserService us;

    @RequestMapping("/view")
    public String view(){
        return "test";
    }

    @RequestMapping("/view2")
    public String view2(){
        return "hello";
    }


    @RequestMapping("/transaction")
    @ResponseBody
    public Object test(){
        User user = new User();
        user.setUserName("张全蛋");
        user.setPassWord("8888888888");
        user.setEmail("999999@99.com");
        user.setSex("male");
//        User u = us.save(user);

//        log.info(u.toString());

//        return u;
        return null;
    }

}
